import type { AppRouteModule } from "@/router/types";

import { LAYOUT } from "@/router/constant";
// ts中使用i18n
import i18n from "@/locales";
// i18n Error: 类型实例化过深，且可能无限。
const { t }: any = i18n.global;

const charts: AppRouteModule = {
  path: "/charts",
  name: "Charts",
  component: LAYOUT,
  redirect: "/charts/histogram",
  meta: {
    title: t("Menus.Charts.name"),
    icon: "moon",
  },
  children: [
    {
      path: "histogram",
      name: "Histogram",
      component: () => import("@/views/charts/histogram/index.vue"),
      meta: {
        title: t("Menus.Charts.histogram"),
      },
    },
    {
      path: "line",
      name: "Line",
      component: () => import("@/views/charts/line/index.vue"),
      meta: {
        title: t("Menus.Charts.line"),
      },
    },
  ],
};

export default charts;
